package 每日一题OJ;

import java.util.Stack;

/**
 * @author shy_black
 * @date 2019/3/23 23:14
 * @Description:
 */
public class 俩个栈实现队列 {
    Stack<Integer> stack1 = new Stack<Integer>();
    Stack<Integer> stack2 = new Stack<Integer>();

    public void push(int node) {
        while(stack1.size() != 0) {
            stack2.push(stack1.pop());
        }
        stack1.push(node);
        while(stack2.size() != 0) {
            stack1.push(stack2.pop());
        }
    }

    public int pop() {
        return stack1.pop();
    }
}